#ifndef __ATOMTRACE_BVH_NODE_H_
#define __ATOMTRACE_BVH_NODE_H_

#include "AABBox.h"

namespace AtomTrace{
    class Ray;
    class HitRecord;
    class atBVHNode{
    public:
        //int mAddress;
    	int start_addr;
        int numTri;   // -1 if is interio node 
        int childID;  // Left child address if is interio node, 
                      // and first trianle address if it is leaf node
        AABBox mBox;

        atBVHNode(); // default constructor load root node
        atBVHNode(int nodeID);

        void LoadFromGM(int nodeID);
        bool Intersect(const Ray & ray, float & hit);
    };
}

#endif // __ATOMTRACE_BVH_NODE_H_
